import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { BrowserModule } from '@angular/platform-browser';
// pages
import { LoginComponent } from './pages/login/login.component';
import { RegComponent } from './pages/reg/reg.component';
import { ForgetComponent } from './pages/forget/forget.component';
import { InfoComponent } from './pages/info/info.component';
import { DashboardComponent } from './pages/dashboard/dashboard.component';
import { AuthGuard } from './providers/auth.guard';



// pages
export const routingPages = [LoginComponent,RegComponent,ForgetComponent,InfoComponent,DashboardComponent];

// chilren
export const routingPagesComponents = [ ];

const routes: Routes = [
  // 行业分析
  {
    path: 'dashboard', component: DashboardComponent, canActivate: [AuthGuard]
    // , children: [
    //   { path: '', redirectTo: "sell", pathMatch: 'full' },
    //   { path: 'sell', component: DashboradSellComponent },
    //   { path: 'category', component: DashboradPie },
    //   { path: 'list', component: DashBoradTopList },
    //   { path: 'word', component: WordTrendComponent, data: { type: "cat" } },
    //   { path: 'doubleProduct', component: DoubleDashProductComponent },
    //   { path: '**', redirectTo: "sell" }
    // ]
  }, 
  { path: 'login', component: LoginComponent },
  { path: 'reg', component: RegComponent },
  { path: 'forget', component: ForgetComponent },
  { path: 'info', component: InfoComponent },
  { path: '', redirectTo: "/dashboard", pathMatch: 'full' },
  { path: '**', redirectTo: "/dashboard" }
];

@NgModule({
  imports: [BrowserModule, BrowserAnimationsModule, RouterModule.forRoot(routes)],
  exports: [RouterModule],
  providers: []
})
export class AppRoutingModule { }
